Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications
Executing an asynchronous request
You execute an asynchronous request using the
RUNstatement with theASYNCHRONOUSoption (theRUN...ASYNCHRONOUSstatement). With this option, you can specify a variable to return an asynchronous request handle used to uniquely identify and maintain the status of the asynchronous request. You can also specify an internal procedure to use as the event procedure to handle the response from the asynchronous request. For more information on theRUN...ASYNCHRONOUSstatement, see theRUNstatement entry in OpenEdge Development: Progress 4GL Reference .When specifying the
RUN...ASYNCHRONOUSstatement, you can also includeINPUT,OUTPUT, andINPUT-OUTPUTparameters similar to the parameters on a synchronousRUNstatement. As with the synchronousRUNstatement, the input parameters represent values passed to the remote procedure. However, unlike the synchronousRUNstatement, the output parameters do not return results from the remote procedure directly on theRUN...ASYNCHRONOUSstatement. The values for these output parameters are not available until the asynchronous request completes and the client handles the associatedPROCEDURE-COMPLETEevent. On detecting this event, the client executes the specified event procedure, which returns the values as input parameters to the event procedure. Thus, the output parameters on theRUN...ASYNCHRONOUSstatement serve only as placeholders to map the signature of the remote procedure on the AppServer. For more information, see the "Handling the response from an asynchronous request" section.Asynchronous request handles
Associated with each asynchronous request is an asynchronous request handle. An instance of this handle is created each time you execute the
RUN...ASYNCHRONOUSstatement. Thus, you can use this handle to obtain information on a specific asynchronous request.The Progress 4GL client allows you to access this handle in three ways:
- Using the
SETasync-request-handleoption on theRUN...ASYNCHRONOUSstatement.- Using the
FIRST-ASYNC-REQUESTandLAST-ASYNC-REQUESTattributes of the server handle or theNEXT-SIBLINGandPREV-SIBLINGattributes of the asynchronous request handle to walk through the valid asynchronous request handles for the specified AppServer.- Accessing the
SELFsystem handle within an event procedure in response to the asynchronous request.For more information on using the asynchronous request handle, see the "Handling the response from an asynchronous request" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |